package com.hrms.domain;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.hrms.core.Utils;

@PersistenceCapable(detachable="true")
public class TaskStatusLog extends BusinessObjectImpl {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Key taskKey; //Key Index of PI Reference Item
	
	@Persistent
	private Date date;
	
	@Persistent
	private String status;
	
	@Override
	public void jdoPreStore()  {
		if(getDate() == null){
			setDate(Utils.getTodayDate());
		}
	}


	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public Key getTaskKey() {
		return taskKey;
	}

	public void setTaskKey(Key taskKey) {
		this.taskKey = taskKey;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	} 

}
